local shentui = fk.CreateSkill {
  name = "lingling__shentui",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__shentui"] = "身退",
  [":lingling__shentui"] = "锁定技，当其他角色对你使用锦囊牌时，若此牌名的牌你未因〖王师〗使用过，则此牌对你无效，否则你摸一张牌。",
}

shentui:addEffect(fk.CardUsing, {
  anim_type = "defensive",
  can_trigger = function(self, event, target, player, data)
    return player:hasSkill(shentui.name) and target ~= player and
      data.card.type == Card.TypeTrick and table.contains(data.tos, player)
  end,
  on_use = function(self, event, target, player, data)
    if table.contains(player:getTableMark("@$lingling__wangshi"), data.card.trueName) then
      player:drawCards(1, shentui.name)
    else
      data.nullifiedTargets = data.nullifiedTargets or {}
      table.insertIfNeed(data.nullifiedTargets, player)
    end
  end,
})

return shentui
